package com.chezhujie.www.enums;

import com.chezhujie.www.core.init.mysql.annotation.Enum;

/**
 * 订单生成状态
 * Created by 汤伟杰 on 2017/7/9.
 */
@Enum(name="runningstatus",type = "select")
public enum  RunningStatus {
    RUNNING("生成中",0),SUCCESS("生成成功",1),FAILED("生成失败",2);
    private String name;
    private int index;
    // 构造方法
    private RunningStatus(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (RunningStatus c : RunningStatus.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
